package com.yjd.pub.base.service;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.base.model.IntroDetailModel;
import com.yjd.comm.base.service.IIntroDetailService;
import com.yjd.pub.base.dao.IIntroDetailDao;

/**
 * <b>description</b>：详情业务实现<br>
 * <b>time</b>：2017-06-27 08:53:25 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
@Service("introDetailService")
public class IntroDetailServiceImpl extends BaseServiceImpl implements IIntroDetailService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public IntroDetailModel insert(IntroDetailModel model) throws Exception {
		return this.introDetailDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(IntroDetailModel model) throws Exception {
		return this.introDetailDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param detail_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long detail_id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("detail_id", detail_id);
		return this.introDetailDao.deleteModel(paramMap, true);
	}

	@Resource
	private IIntroDetailDao introDetailDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.introDetailDao;
	}

}
